home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10701 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.ultranet.com!usenet
  2. From: kbrady@ultranet.com (Ken Brady)
  3. Newsgroups: comp.lang.c,comp.lang.c++
  4. Subject: Speed of C program vs. Speed of Pascal program
  5. Date: 9 Mar 1996 17:31:05 GMT
  6. Organization: UltraNet Communications, Inc.
  7. Message-ID: <4hsf8p$c5d@caesar.ultra.net>
  8. NNTP-Posting-Host: kbrady.ultranet.com
  9. X-Newsreader: NeoLogic News for OS/2 [version: 4.2 UNREGISTERED 28 days remaining]
  10.  
  11. I recently began learning to program in C/C++ after many years
  12. of using Borland Turbo Pascal (v6.0).  I have been porting a data analysis 
  13. program into C/C++, and notice that a subroutinefor reading large tables of 
  14. numbers (ASCII) and loading these numbers into (binary) arrays proceeds much 
  15. more rapidly in my C program than in my Pascal program.  For one large table, 
  16. my Pascal program requires about 10 s to load the table, while the C program 
  17. loads it in less than 1 second.
  18.  
  19. The I/O algorithms in these programs are essentially identical.  I deduce 
  20. that the C atof function is much faster than the Pascal Val function.  Is 
  21. this typical?
  22.  
  23. My C/C++ compiler is Watcom 10.5, running under OS/2.
  24.  
  25. kbrady@ultranet.com
  26.  
  27.  
  28.